package com.woniuxy.project.campus.canteen.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.woniuxy.project.campus.canteen.model.Merchantapplication;
import com.woniuxy.project.campus.canteen.service.MerchantapplicationService;
import com.woniuxy.project.campus.util.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 猫将军
 * @since 2025年02月19日
 */
@RestController
@RequestMapping("/merchantapplication")
public class MerchantapplicationController {


    @Resource
    private MerchantapplicationService merchantapplicationService;
    //查询所有待审批的入驻商家
    @ApiOperation(value = "查询所有待审批的入驻商家")
    @GetMapping("/viewTheApplicationList")
    public Result viewTheApplicationList(){
       QueryWrapper<Merchantapplication> queryWrapper = new QueryWrapper<>();
       queryWrapper.eq("audit_status",1);
       List<Merchantapplication> list = merchantapplicationService.list(queryWrapper);
        return Result.success(list);
    }
}

